//
//  TreeView.h
//  DemoTree
//
//  Created by 尤维维 on 2017/11/10.
//  Copyright © 2017年 EmicNet. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "TreeNodeModel.h"
@class TreeView;

@protocol TreeViewDelegate

- (CGFloat)tableViewCellHeight;

- (CGFloat)tableViewHeadHeight;

- (UITableViewCell *)tableView:(UITableView *)tableView cellOfTheIndexPathModel:(id)model;

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath model:(id)model;

@end

@interface TreeView : UIView

- (instancetype)initWithFrame:(CGRect)frame delegate:(id)delegate;

@property(nonatomic, strong) TreeNodeModel *model;

@property(nonatomic, strong) NSArray <TreeNodeModel *>*items;

@property(nonatomic, strong) void(^reloadBlock)(void);

@property(nonatomic, strong) id <TreeViewDelegate>delegate;

- (CGFloat)height;

- (void)reload;

@end

